home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / vedt.zip / DEMO7.VDM < prev    next >
Text File  |  1990-05-18  |  6KB  |  155 lines

  1. RI(9)/VEDIT Family - Keystroke Macros/
  2. M(H)            !Display header
  3.  
  4. YT/
  5. Keystroke macros let you assign a commonly typed sequence of keys to a single
  6. key.  Pressing that single key then types the whole sequence - saving you
  7. time and reducing the chances for error.
  8.  
  9. For example, if you were repeatedly typing the phrase "attached and included
  10. herein by reference", you could define the key <CTRL-A> to type out the
  11. whole phrase each time it was pressed.
  12.  
  13. Keystroke macros are also used to set up "hot keys" for accessing the menu
  14. functions directly.  This speeds editing for the experienced user.
  15.  
  16. With VEDIT PLUS, keystroke macros have the additional capability of accessing
  17. the powerful Command Mode macro language.  This lets you create almost any edit
  18. function you might want.
  19.  
  20. You can set up as many keystroke macros as you like.  Keystroke macros can be
  21. "temporary" or can be built permanently into the editor.
  22.  
  23. /
  24. M(K)
  25.  
  26. YWB(1) 9
  27. Q26YEA            !Set editing attribute
  28. YWS(1) Q27YEA        !Set attribute in lower window "1"
  29. EZY            !Empty edit buffer
  30. EB demo.txt        !Load demo file
  31. Z            !Goto end-of-file
  32.  
  33. EE(1)
  34. B#K
  35. I/In this example keystroke macro, you will assign the words "VEDIT PLUS" to the 
  36. key <CTRL-V>.  <ALT-K> is itself a keystroke macro which performs the {MISC, 
  37. Keystroke Macros, Record} menu function.
  38.  
  39. Press <ALT-K>.  At the prompt press <CTRL-V> and then <ESC>.  You are now in 
  40. "Record Mode" - note the status line.  Type "VEDIT PLUS".  Press <ALT-K> again 
  41. to turn off record mode.  Press <CTRL-V>.  If all went well, the words "VEDIT 
  42. PLUS" will appear.        --- Press <ESC> to continue ---/
  43. B -V
  44. EE(@)
  45. V
  46.  
  47. EE(1)
  48. B#K
  49. I/Many pre-configured keystroke macros directly access functions in the menu
  50. system as "hot keys".  For example, <ALT-F3> is configured to perform [MENU],
  51. select the "Goto" sub-menu and select the "Matching ()" function.  Therefore,
  52. we say that <ALT-F3> is a "hot key" for {GOTO, Matching ()}.
  53.  
  54. You can view all of the active keystroke macros by entering the "Misc" sub- 
  55. menu (press <ALT-M>), selecting the "Keystroke Macros" sub-menu and selecting 
  56. "Display Macros".  Note that the last displayed macro is for "^V" which you 
  57. just added.    --- Press <ESC> to continue ---/
  58.  
  59. B -V
  60. EE(@)
  61. V
  62.  
  63. EE(1)
  64. B#K
  65.  
  66. I/Now lets add another "hot key" to directly access the {HELP, Status Display}
  67. function.  We will assign it to <SHIFT-F1>.  Sub-menus and most menu functions
  68. can simply be selected by their first letter.
  69.  
  70. Press <ALT-K>.  At the prompt press <SHIFT-F1> and then <ESC>.  Now press 
  71. press <F1>, then "H", then "S".  Press <ALT-K> again to turn off the record 
  72. mode.  Try out the new keystroke macro by pressing <SHIFT-F1>.  The pop-up 
  73. status display should appear.
  74.         --- Press <ESC> to continue ---/
  75. B -V
  76. EE(@)
  77. V
  78.  
  79. EE(1)
  80. B#K
  81. I/Display the keystroke macros again using {MISC, Keystroke Macros, Display}.
  82. Note that the new "SHIFT-F1" is shown as "[MENU]-HS".  Therefore, <SHIFT-F1>
  83. is the same as pressing the [MENU] key, then "H" and then "S".
  84.  
  85. VEDIT remembers keystroke macros in terms of the functions they access, e.g.
  86. [MENU], and NOT the keys assigned to the functions, e.g. <F1>.  This way,
  87. should the keyboard layout change (e.g. you assign a different key to [MENU]),
  88. the keystroke macros will still work.
  89.         --- Press <ESC> to continue ---/
  90. B -V
  91. EE(@)
  92. V
  93.  
  94. EE(1)
  95. B#K
  96. I/You can also enter new keystrokes by using {MISC, Keystroke Macros, Add} 
  97. (assigned to <CTRL-D>).  Instead of recording your keystrokes while you edit,
  98. you enter the keystrokes directly into a window.  This method if preferable
  99. for keystroke macros which access VEDIT PLUS's command macro language.
  100.  
  101. Lets redo our first example using this method.  Press <CTRL-D>.  At the first
  102. prompt press <CTRL-V> and <ESC>.  Press "Y" to confirm.  At the second prompt
  103. type "VEDIT PLUS" and press <ESC>.  Now press <CTRL-V> to test it.  "VEDIT
  104. PLUS" should again appear.        --- Press <ESC> to continue ---/
  105. B -V
  106. EE(@)
  107. V
  108.  
  109. EE(1)
  110. B#K
  111. I/Now lets use VEDIT PLUS's macro language to create an editing function to
  112. delete characters from the beginning of the line up to the cursor:
  113.  
  114. Press <CTRL-D>.  At the first prompt press <CTRL-B>.  Then press <ESC>.  At
  115. the second prompt first press <CTRL-E> (this is the [VISUAL EXIT] function).
  116. Then type (without quotes) "0K".  Then press <ESC> again.
  117.  
  118. Move the cursor to the middle of a line and press <CTRL-B>.  The characters
  119. before the cursor will be deleted.   --- Press <ESC> to continue ---/
  120.  
  121. B -V
  122. EE(@)
  123. V
  124.  
  125. EE(1)
  126. B#K
  127. I/This keystroke macro also uses VEDIT PLUS's macro language to create an
  128. editing function to duplicate a line of text:
  129.  
  130. Press <CTRL-D>.  At the prompt press <ALT-D>.  Then press <ESC>.  At the
  131. second prompt first press <CTRL-E>.  Then type (without quotes) "0L G". Then
  132. press <ESC> again.
  133.  
  134. Press <ALT-D>.  If all went well, the current line of text will be duplicated.
  135.         --- Press <ESC> to continue ---/
  136. B -V
  137. EE(@)
  138. -L -@$N/|S|A/ 0L    !Position cursor
  139. V
  140.  
  141. EE(1)
  142. B#K
  143. I/The menu function {CONFIG, Save into VEDIT} can be used to save new 
  144. keystroke macros (and other configuration changes) permanently into VEDIT.
  145.  
  146. VEDIT PLUS comes with two libraries of useful macros including a library of 
  147. commonly requested keystroke macros.  VEDIT PLUS also has the ability to 
  148. convert keystroke macros into an easy to edit file format.  Keystroke macros 
  149. which use VEDIT PLUS's macro language can also be built into VEDIT - VEDIT can 
  150. run any macros written with VEDIT PLUS.
  151.         --- Press <ESC> to return to the Main Menu ---/
  152. B -V
  153. EE(@)
  154. V
  155.